//
//  UIView+Frame.m
//  YKWBDemo
//
//  Created by 千锋 on 16/1/6.
//  Copyright (c) 2016年 1000phone. All rights reserved.
//

#import "UIView+Frame.h"

@implementation UIView (Frame)

/** setter方法*/
- (void)setX:(CGFloat)x
{
    CGRect frame = self.frame;
    frame.origin.x = x;
    self.frame = frame;
}
- (void)setY:(CGFloat)y
{
    CGRect frame = self.frame;
    frame.origin.y = y;
    self.frame = frame;
}
- (void)setWith:(CGFloat)with
{
    CGRect frame = self.frame;
    frame.size.width = with;
    self.frame = frame;
}
- (void)setHeight:(CGFloat)height
{
    CGRect frame = self.frame;
    frame.size.height = height;
    self.frame = frame;
}

/** getter方法*/
- (CGFloat)x
{
    return self.frame.origin.x;
}
- (CGFloat)y
{
    return self.frame.origin.y;

}
- (CGFloat)with
{
    return self.frame.size.width;
}
- (CGFloat)height
{
    return self.frame.size.height;
}



@end
